<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>后台管理中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Admin panel developed with the Bootstrap from Twitter.">
    <meta name="author" content="travis">
    <link rel="icon" href="images/leaf.ico" type="image/x-icon" />
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/selfcommon.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <script src="js/jquery-2.1.4.min.js"></script>
    <style type="text/css">
        .table th, .table td{text-align: center;}
        ul.navlis{margin-left:0px;}
        ul.navlis li{float:left;list-style:none;padding: 0 3px;}
        ul.navlis li:nth-of-type(1){color:#000;}
        ul.navlis li:nth-of-type(5){color:#0c77ac;}
        p.help-block-error{color:#f36;}
        div.radio{width: 5%;display: block;float: left;}
        div.form-actions{background:0;border-top:0}
        .file{position:relative;display:inline-block;background:#5cb85c;border:1px solid #5cb85c;border-radius:4px;padding:4px 12px;overflow:hidden;color:#fff;text-decoration:none;text-indent:0;line-height:20px}
        .file input{position:absolute;font-size:100px;right:0;top:0;opacity:0}
        .file:hover{background:#5cb85c;border-color:#5cb85c;color:#fff;text-decoration:none}
    </style>
</head>
<body>
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container-fluid">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="">后台管理</a>
            <div class="btn-group pull-right">
                <a class="btn"><i class="icon-user"></i>admin</a>
                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="">Logout</a></li>
                </ul>
            </div>
            <div class="nav-collapse">
                <ul class="nav">
                    <li><a href="">Home</a></li>
                    <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">菜单管理<b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="">菜单列表</a></li>
                            <li class="divider"></li>
                            <li><a href="">添加菜单</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span2">
            <div class="well sidebar-nav">
                <dl>
                    <dt class="nav-header">
                        <a href="#" class="curs">
                            <i class="icon-leaf"></i>
                            <span>分类管理</span>
                        </a>
                    </dt>
                    <dd>
                        <ul class="mycheck">
                            <li><a href="">分类列表</a></li>
                            <li><a href="">添加分类</a></li>
                        </ul>
                    </dd>
                </dl>
                <dl>
                    <dt class="nav-header">
                        <a href="#" class="curs">
                            <i class="icon-user"></i>
                            <span>用户管理</span>
                        </a>
                    </dt>
                    <dd>
                        <ul class="mycheck">
                            <li><a href="">用户列表</a></li>
                            <li><a href="">锁定用户</a></li>
                        </ul>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="span10">
        	<div class="row-fluid" id="super">
                <div class="page-header">
                    <ul class="navlis">
                        <li>首页</li>
                        <li>>></li>
                        <li>其它管理</li>
                        <li>>></li>
                        <li>添加新闻</li>
                    </ul>
                </div>
        		<form  action="" method="post" class="form-horizontal">
        			<fieldset>
        				<div class="control-group">
        					<label class="control-label" for="title">标题</label>
        					<div class="controls">
        						<input type="text" name="data[title]" class="input-xlarge"/>
        					</div>
        				</div>
        				<div class="control-group">
        					<label class="control-label" for="url">链接地址</label>
        					<div class="controls">
        						<input type="text" name="data[url]" class="input-xlarge"/>
        					</div>
        				</div>
        				<div class="control-group">
        					<label class="control-label" for="file"></label>
        					<div class="controls">
        						<a href="javascript:;" class="file">选择文件
                                    <input type="file" id="upload">
                                </a>
        					</div>
        				</div>
        				<div class="control-group">
        					<label class="control-label" for="url"></label>
        					<div class="controls">
        						<div class="s-pic" style="border:1px dashed #ccc;width:460px;height:170px;">
        							<img src="/" width="430px" height="140px" style="margin:0 auto;" id="previw">
        						</div>						
        					</div>
        				</div>			
        				<div class="form-actions">
        					<input type="hidden" name="data[img]" class="s-url">
        					<input type="submit" class="btn btn-success btn-large" value="Save Changes" />
                            <a class="btn" href="javascript:;">Cancel</a>
        				</div>					
        			</fieldset>
        		</form>
        	</div>
        </div>
    </div>
    <footer class="well" style="margin-top: 50px;text-align:center;">
        &copy; Copyright @ 2020-2022 bawei.cn All Rights Reserved | ICP备18015440号-2
    </footer>
</div>
</body>
<script type="text/javascript">
    $(document).on('change', '#upload', function () {
       let formData = new FormData();
       //赋值
       formData.append("imgFile", $("#upload")[0].files[0]);
       formData.append("_csrf","");
       let str="";
       $.ajax({
           url : "",
           type : "POST",
           data : formData,
           processData : false,
           contentType : false,
           beforeSend: function () {
               //可以做一些正在上传的效果
           },
           success : function(data) {
                if(data.status)
                {
                    $('#previw').attr('src',data.url);
                    $('.s-url').val(data.url);
                }
           },
           error : function(responseStr) {
               console.log(responseStr);
           }
       });
    })  
</script>
<script src="js/bootstrap.min.js"></script><script type="text/javascript">
    $(function(){
        $('.sidebar-nav dt a').click(function(){
            $(this).parent().next("dd").slideToggle("slow").siblings("dd").slideUp("slow");
            return false;
        });
    });
</script>
</html>
